#include "type.h"
namespace sr {
Color Color::operator*(const float& w) const
{
    return Color
    {
        r*w,g*w,b*w
    };
}
int Color::toInt()
{
    int R, G, B;
    R = static_cast<int>(r * 255.0f);
    G = static_cast<int>(g * 255.0f);
    B = static_cast<int>(b * 255.0f);

    return (R<<16)|(G<<8)|B;
}
Vect4 Vect4::Normalize()
{
    float rec = 1.0f / sqrt(x*x+y*y+z*z);
    x *= rec;
    y *= rec;
    z *= rec;
    return *this;
}
}